package ch.bfh.mobicomp.soda2.magnetometer;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

public class OnBootBroadcastReceiver extends BroadcastReceiver{

	@Override
	public void onReceive(Context context, Intent intent) {

		if (intent.getAction().equals("android.intent.action.BOOT_COMPLETED")) {
			Log.d(MainActivity.LOG_TAG, "Device Booted");

			if(true) { //TODO only if sharedProperties say it was activated before
				Intent intentToStart = new Intent(context,ControlUnitService.class);
				context.startService(intentToStart);
			}

			Log.d(MainActivity.LOG_TAG, "Service Started");
		}
	}
}
